#ifndef __DEVICE_H_ASJ1UYBVNZMZWIUF4BH__
#define __DEVICE_H_ASJ1UYBVNZMZWIUF4BH__

#pragma warning(disable : 4005)

#include "comsup.h"
#include "wudfddi.h"

#pragma warning(default : 4005)

class Device :
    public CUnknown,
    public IQueueCallbackDeviceIoControl,
    public IQueueCallbackCreate,
    public IQueueCallbackRead,
    public IQueueCallbackWrite,
    public IFileCallbackClose,
    public IFileCallbackCleanup
{
private:
    IWDFDevice *m_FxDevice;

private:
    Device(VOID);
    HRESULT Initialize(__in IWDFDriver *FxDriver, __in IWDFDeviceInitialize *FxDeviceInit);

public:
    static HRESULT CreateInstance(__in IWDFDriver *FxDriver, __in IWDFDeviceInitialize *FxDeviceInit, __out Device **aDevice);
    HRESULT Configure(VOID);

public:
    virtual ULONG STDMETHODCALLTYPE AddRef(VOID);
    virtual ULONG STDMETHODCALLTYPE Release(VOID);
    virtual HRESULT STDMETHODCALLTYPE QueryInterface(__in REFIID InterfaceId, __out PVOID *Object);

    STDMETHOD_ (void, OnCreateFile)(IWDFIoQueue *pQueue, IWDFIoRequest *pRequest, IWDFFile *pFileObject);
    STDMETHOD_ (void, OnCleanupFile)(IWDFFile *pFileObject);
    STDMETHOD_ (void, OnCloseFile)(IWDFFile* pFileObject);
    STDMETHOD_ (void, OnDeviceIoControl)(IWDFIoQueue* pQueue, IWDFIoRequest* pRequest, ULONG ControlCode, SIZE_T InputBufferSizeInBytes, SIZE_T OutputBufferSizeInBytes);
    STDMETHOD_ (void, OnRead)(IWDFIoQueue* pQueue, IWDFIoRequest* pRequest, SIZE_T NumOfBytesToRead);
    STDMETHOD_ (void, OnWrite)(IWDFIoQueue* pQueue, IWDFIoRequest* pRequest, SIZE_T NumOfBytesToWrite);

};

#endif
